//
//  SQNoticeContentViewController.m
//  pai
//
//  Created by linjunjing on 14-11-19.
//  Copyright (c) 2014年 linjunjing. All rights reserved.
//

#import "SQNoticeContentViewController.h"

@interface SQNoticeContentViewController ()

@end

@implementation SQNoticeContentViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self setTitle:@"通知详情"];
    
    [self initLabel];
}
-(void)initLabel
{
    _scrollView = [[UIScrollView alloc]init];
    //[_scrollView setBackgroundColor:[UIColor colorWithRed:0.6 green:0.6 blue:0.6 alpha:0.5]];
    _scrollView.frame = CGRectMake(0, self.MyNavigationBar.frame.origin.y+self.MyNavigationBar.frame.size.height, 320, [[UIScreen  mainScreen] bounds].size.height - 44 - self.MyNavigationBar.frame.origin.y-self.MyNavigationBar.frame.size.height);
    _scrollView.pagingEnabled = NO;
    _scrollView.delegate = self;
    _scrollView.bounces = YES;
    [self.view addSubview:_scrollView];
    
    //标题
    UILabel* title = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    [title setNumberOfLines:0];
    [title setFont:[UIFont boldSystemFontOfSize:30]];
    [title setTextColor:[UIColor blackColor]];
    [title setText:self.list.noticeTitle];
    [title setTextAlignment:NSTextAlignmentCenter];
    CGSize size = [title.text sizeWithFont:[UIFont systemFontOfSize:30] constrainedToSize:CGSizeMake(280, 3000)];
    title.frame = CGRectMake(20, 20, 280, size.height);
    [_scrollView addSubview:title];
    
    //内容
    UILabel* label = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 0, 0)];
    [label setNumberOfLines:0];
    [label setFont:[UIFont systemFontOfSize:16]];
    [label setTextColor:[UIColor blackColor]];
    [label setText:self.list.noticeContent];
    size = [label.text sizeWithFont:[UIFont systemFontOfSize:16] constrainedToSize:CGSizeMake(270, 3000)];
    [label setFrame:CGRectMake(10, title.frame.origin.y + title.frame.size.height + 30, size.width, size.height)];
    [_scrollView addSubview:label];
    
    
    _scrollView.contentSize = CGSizeMake(label.frame.size.width, label.frame.size.height);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
